function fn() {
    var a = 2;
    var b = a;
    a = 1;
    console.log(a);//1
    console.log(b);//2
}
fn()


function fn() {
    var a = { name: "zhangsan" };
    var b = a;
    a.name = "lisi";
    console.log(a);//{name: "lisi"}
    console.log(b);//{name: "lisi"}
}
fn()